package ru.st.selenium.pages;

import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;

public class HomePage extends InternalPage {
	
	public HomePage(PageManager pages) {
		super(pages);
	}
	
	 @FindBy(xpath = "//div[@class='movie_box']/div[@class='title'])[1]")
	  private WebElement firstDescriptionLocator;
	 
	 @FindBy(xpath = "//*[contains(text(), 'Remove')]")
	  private WebElement removeButton;

	 public String isFirstDescription() {
		  return firstDescriptionLocator.getText();
		  }
	 
	 public HomePage clickFirstDescription(){
		 firstDescriptionLocator.click();
		 return this;
	 }
		 
	 public void clickRemoveButton(){
		 removeButton.click();
		 }
	 
	 public boolean IsFilmVisible(String film){
		 return driver.getPageSource().contains(film);
	 }
	 
}
